package com.project.gcsj5.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Data;

/**
 * 用户实体类
 * 对应数据库中的user表，存储系统用户信息
 */
@TableName("user") // 指定映射数据库表名
public class User {
    @TableId(type = IdType.AUTO) // 主键自增策略
    private int id;             // 用户唯一标识ID

    private String name;        // 用户姓名
    private String gender;      // 用户性别
    private int age;            // 用户年龄
    private int permission;     // 用户权限等级
    private String password;    // 用户密码（建议存储加密后的密码）
    private String email;       // 用户电子邮箱

    /**
     * 全参构造函数
     * @param id 用户ID
     * @param name 用户姓名
     * @param gender 用户性别
     * @param age 用户年龄
     * @param permission 权限等级
     * @param password 登录密码
     * @param email 电子邮箱
     */
    public User(int id, String name, String gender, int age, int permission, String password, String email) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.permission = permission;
        this.password = password;
        this.email = email;
    }

    /**
     * 无参构造函数
     */
    public User() {
    }

    // 以下是各属性的getter和setter方法

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getPermission() {
        return permission;
    }

    public void setPermission(int permission) {
        this.permission = permission;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}